/*
 * FeeHandler.java
 *
 * Created on April 12, 2007, 8:01 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package edu.byu.isys413.group1E.handlers;

/**Handles all business logic concerning fee's
 *
 * @author Jon
 */
public class FeeHandler {
    
    /** Creates a new instance of FeeHandler */
//    public FeeHandler() {
//    }
//    public boolean determineFee(DateIn)
//    {
//        
//        return false;
//    }
//    
//    public RevenueSourceBO makeFeeRSBO(RentalBO rentalBO, int daysLate, double feeAmount, EmployeeBO employee) {
//        //FeeBO = fbo = null;
//        
//        employee = "0000011106a3cc380000017f000002";
//        FeeBO fbo = (RevenueSrcBO)FeeDAO.getInstance().create();
//        fbo.setEmployee(employee);
//        fbo.setDaysLate(daysLate);
//        
//        rentalBO.getRevSrcID();
//        fbo.
//                fbo.setRentalID(rentalBO.getRevSrcID());
//        fbo.setAmount();
//        
//        ConceptualRentalBO crbo = null;
//        ForRentBO forRentBO = null;
//        ArrayList<String> forRentDescriptionList = new ArrayList<String>();
//        String[] forRentDescArray = null;
//        String[] forRentNameArray = null;
//        try {
//            forRentBO = (ForRentBO) ForRentDAO.getInstance().readBySKU(SKU);
//            crbo = getConcepRentalByPhyProdID(forRentBO.getProductID());
//        } catch (ConnectionPoolException ex) {
//            ex.printStackTrace();
//        } catch (SQLException ex) {
//            ex.printStackTrace();
//        } catch (DataException ex) {
//            ex.printStackTrace();
//        }
//        
//        //set the date for the transaction
//        Calendar cal = Calendar.getInstance();
//        Date today = cal.getTime();
//        SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
//        String todaysDate = fmt.format(today);
//        RentalBO rbo = null;
//        try {
//            rbo = (RentalBO) RentalDAO.getInstance().create();
//        } catch (Exception ex) {
//            ex.printStackTrace();
//        }
//        rbo.setDateOut(todaysDate);
//        MyDate md = new MyDate();
//        md = md.stringToMyDate(todaysDate);
//        md.addDay(days);
//        String dueDate = md.getFullDateString();
//        rbo.setDateDue(dueDate);
//        rbo.setDescription("bob");
//        String prodName = crbo.getProductName();
//        String prodDescription = crbo.getDescription();
//        double pricePerDay = rbo.getPricePerDay();
//        
//        rbo.setDescription(prodName + ", (" + prodDescription + "), " + days + " day rental @ $" + pricePerDay + "/day");
//        // need to get the price per day from the crbo.
//        rbo.setPrice(days * rbo.getPricePerDay());
//        RevenueSourceBO revSrcBO = (RevenueSourceBO)rbo;
//        return revSrcBO;
//    }
//    public FeeBO calculateFee(RentalBO rbo){
//        ConceptualRentalBO crbo = (ConceptualRentalBO)getConcepRentalByRentalBO(rbo);
//        FeeBO fbo = (FeeBO)FeeDAO.getInstance().create();
//        Double totalFee = 0;
//        int daysLate = getDaysBetween(rbo.getDateIn(), rbo.getDateDue());
//        if (daysLate > 0) {
//            totalFee = daysLate * crbo.getLateFeePerDay();;
//        }
//        return fee;
//    }
}
